import 'package:dio/dio.dart';
import 'package:flutterhouse/constants/index.dart';
import 'package:flutterhouse/utils/DioRequest.dart';

// 1.获取验证码
Future<dynamic> sendCodeAPI(Map<String, String> params) =>
    requestDio.get(HTTP_PATH.SEND_CODE, params: params);
// 封装登录
Future<dynamic> loginAPI(data) => requestDio.post(HTTP_PATH.LOGIN, data: data);
// 获取用户信息
Future<dynamic> getUserInfoAPI() => requestDio.get(HTTP_PATH.USER_INFO);
// 修改用户信息
Future<dynamic> updateUserInfoAPI(data) =>
    requestDio.put(HTTP_PATH.USER_INFO, data: data);
// 5. 上传用户头像
Future<dynamic> uploadAvatarAPI(FormData data) =>
    requestDio.upload(HTTP_PATH.UPLOAD, data: data);
